﻿using System;
using System.Collections.Specialized;

namespace Nydus.WebForms.FrontendModel
{
    /// <summary>
    /// Base interface for all views.
    /// </summary>
    /// <typeparam name="TModel">The type of the model associated with the view.</typeparam>
    public interface IView<TModel>
    {
        /// <summary>
        /// Gets or sets the model.
        /// </summary>
        TModel Model { get; set; }

        /// <summary>
        /// Gets or sets the additional view data.
        /// </summary>
        dynamic ViewData { get; }

        /// <summary>
        /// Get query string parameters from Request.QueryString
        /// </summary>
        NameValueCollection QueryString { get; }

        /// <summary>
        /// Occurs when view is initialized.
        /// </summary>
        event EventHandler Init;

        /// <summary>
        /// Occurs when view is loaded.
        /// </summary>
        event EventHandler Load;

        /// <summary>
        /// Occurs befor view is rendered.
        /// </summary>
        event EventHandler PreRender;
    }
}
